package constutil;

import java.util.Arrays;

/**
 * @Author Gong
 * @Description
 * @dATE 2022/4/25 14:33
 **/
public class MyMsgUtil {
    /**
     * @Author GongXL
     * @Description  获取2个用户的key信息
     * @Date 14:34 2022/4/25
     * @Param [java.lang.String, java.lang.String]
     * @return java.lang.String
     **/
    public static String getMySessionKey(String fromName,String toName){
        String[] nameArry = new String[]{fromName,toName};
        Arrays.sort(nameArry);
        String myChatSessionKey = "";
        for(String name:nameArry){
            myChatSessionKey = myChatSessionKey + "_"+name;
        }
        System.out.println("myChatSessionKey:"+myChatSessionKey);
        return myChatSessionKey;
    }
}
